﻿using System;
using Microsoft.Xna.Framework;

namespace Terraria.ModLoader.IO
{
	// Token: 0x020002D5 RID: 725
	public class RectangleSerializer : TagSerializer<Rectangle, TagCompound>
	{
		// Token: 0x06001C08 RID: 7176 RVA: 0x00432C44 File Offset: 0x00430E44
		public override TagCompound Serialize(Rectangle value)
		{
			TagCompound tagCompound = new TagCompound();
			tagCompound["x"] = value.X;
			tagCompound["y"] = value.Y;
			tagCompound["width"] = value.Width;
			tagCompound["height"] = value.Height;
			return tagCompound;
		}

		// Token: 0x06001C09 RID: 7177 RVA: 0x000141B3 File Offset: 0x000123B3
		public override Rectangle Deserialize(TagCompound tag)
		{
			return new Rectangle(tag.GetInt("x"), tag.GetInt("y"), tag.GetInt("width"), tag.GetInt("height"));
		}
	}
}
